#99乘法表
#for循环
for i in range(1,10):
    for ii in range(1,10):
        if i >= ii:
            print('{} * {} = {:2}'.format(ii,i,i * ii),end = '   ')
    print()

for i in range(1, 10):
    #占位符
    print('             ' * (9 - i), end='   ')
    #倒叙循环
    for ii in range(9, 0, -1):
        if i >= ii:
            print('{} * {} = {:2}'.format(ii, i, i * ii),end = '   ')
    print()

for i in range(1,10):
    a = 10 - i
    for ii in range(1,10):
        if a >= ii:
            print('{} * {} = {:2}'.format(ii,a,a * ii),end = '   ')
    print()

for i in range(1, 10):
    print('             ' * (i -1), end='   ')
    a = 10 - i
    for ii in range(9, 0, -1):
        if a >= ii:
            print('{} * {} = {:2}'.format(ii, a, a * ii), end='   ')
    print()


#while循环
i = 1
while i <= 9:
    ii = 1
    while ii <= i:
        print('{} * {} = {:2}'.format(ii,i,i*ii),end='  ')
        ii += 1
    print()
    i += 1

i = 1
while i <= 9:
    ii = 1
    print('{}'.format('            ') * (9-i), end='  ')
    while ii <= i:
        print('{} * {} = {:2}'.format((i-ii+1),i,(i-ii+1) * i),end='  ')
        ii += 1
    print()
    i += 1

i = 9
while i >= 1:
    ii = 1
    while ii <= i:
        print('{} * {} = {:2}'.format(ii, i, i * ii), end='   ')
        ii += 1
    print()
    i -= 1

i = 9
while i >= 1:
    ii = 1
    print('{}'.format('            ') * (9 - i), end=' ')
    while ii <= i:
        print('{} * {} = {:2}'.format((i - ii +1), i, (i-ii+1) * i), end='  ')
        ii += 1
    print()
    i -= 1